<!--
 * @Author: krsea 965837746@qq.com
 * @Date: 2025-03-04 14:46:14
 * @LastEditors: krsea 965837746@qq.com
 * @LastEditTime: 2025-03-04 15:03:10
 * @FilePath: \vue3-code\2305\week3\m4使用props的值是字符串数组.html
 * @Description: 
 * 
 * Copyright (c) 2025 by ${git_name_email}, All Rights Reserved. 
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>props的值是字符串数组</title>
    <!-- 引入 vue.js -->
    <script src="../js/vue.js"></script>
</head>

<body>
    <!-- div id 为 app 挂载点 -->
    <div id="app">
        <!-- 使用组件 v-bind: 组件的属性  绑定变量  父级 变量-->
        <my-cjl v-bind:msg="msg"></my-cjl>
    </div>

    <!-- 使用 javascript 脚本 -->
    <script type="text/javascript">
        Vue.component('my-cjl', {
            // ... options ...
            props: ['msg'], //接收父级传递数据
            template: '<div>{{ msg }}</div>'
        });
        var app = new Vue({
            el: '#app',
            data: {
                msg: 'app 这个实例的数据'
            }
        });
    </script>
</body>

</html>